// 当面付相关接口
import http from "../common/http.js";

export default {
  //获取店铺收款码数据
  getCollection: (data, needLoading) => {
    return http.GET("/plugin/scan-code-pay/index/get-qrcode", data, needLoading);
  },
  //获取店铺信息
  getStoreInfo: (data, needLoading) => {
    return http.GET("/plugin/scan-code-pay/index/get-store", data, needLoading);
  },
  // 生成订单
  orderPreview: (data, needLoading) => {
    return http.POST(
      "/plugin/scan-code-pay/order/submit-preview",
      data,
      needLoading
    );
  },
  //获取店铺列表
  getCouponList: (data, needLoading) => {
    return http.GET("/plugin/scan-code-pay/index/get-coupon", data, needLoading);
  },
  //提交订单
  submitOrder: (data, needLoading) => {
    return http.POST("/plugin/scan-code-pay/order/submit", data, needLoading);
  },
  //支付订单
  payOrder: (data, needLoading) => {
    return http.GET("/plugin/scan-code-pay/order/pay-data", data, needLoading);
  },
  //会员充值支付订单
  memberPayOrder: (data, needLoading) => {
    return http.GET("/user/member-pay-data", data, needLoading);
  },
  //收款记录
  getRecordList: (data, needLoading) => {
    return http.GET(
      "/plugin/scan-code-pay/index/get-money-record",
      data,
      needLoading
    );
  },
  // 查询支付状态
  getPayStatus: (data) => {
    return http.GET("/plugin/scan-code-pay/order/pay-status", data, false, false);
  },
  // 领取优惠券
  receiveCoupon: (data) => {
    return http.GET("/coupon/saas-receive", data);
  },
  // 我的优惠券列表
  myCouponList: (data) => {
    return http.GET("/coupon/saas-index", data);
  },
  // 领取转赠的优惠券
  receiveGiveCoupon: (data) => {
    return http.GET("/coupon/saas-share-receive", data);
  },
  // 优惠券详情
  getCouponDetail: (data) => {
    return http.GET("/coupon/saas-detail", data);
  },
  // 领券中心列表
  storeCouponList: (data) => {
    return http.GET("/default/saas-coupon-list", data);
  },
  // 获取会员核销码
  getUserCode: (data) => {
    return http.GET("/plugin/integral/index/get-qrcode", data);
  },

  // 获取福利中心订单列表
  getOrderList: (data) => {
    return http.GET("/saas/order-list", data);
  },
  // 删除订单
  deleteOrder: (data) => {
    return http.GET("/saas/delete-order", data);
  },
  // 订单详情
  orderDetail: (data) => {
    return http.GET("/saas/order-detail", data);
  },
  // 获取分账列表
  getSplitAccountList: (data) => {
    return http.GET("/saas/share-profit-record", data);
  },
  // 获取店铺信息
  getStoreDetail: (data) => {
    return http.POST("/new-merchant/face-pay-config", data);
  },
  // 生成当面付订单
  facePaySub: (data, needLoading) => {
    return http.POST("/new-merchant/face-pay", data, needLoading);
  },
  // 当面付支付结果查询
  payOutRes: (data, needLoading) => {
    return http.POST("/new-merchant/pay-result", data, needLoading);
  },
};
